package com.k.kc.util;

/**
 * @author k
 */
public class Test {
    public static void main(String[] args) {
        swap(1,3);
        swapTwo("ljw","456");
        swapThree("ljwa","4a56");
    }
    private static void swap(int a, int b){
        System.out.println("a:"+a + " b:"+b);
        a = a^b;
        b = b^a;
        a = a^b;
        System.out.println("a:"+a + " b:"+b);
    }
    private static void swapTwo(String a, String b){
        System.out.println("a:"+a + " b:"+b);
        a = a + b;
        b = a.substring(0, a.length() - b.length());
        a = a.substring(b.length());
        System.out.println("a:"+a + " b:"+b);
    }
    private static void swapThree(String a, String b){
        System.out.println("a:"+a + " b:"+b);
        String temp;
        temp = a;
        a = b;
        b = temp;
        System.out.println("a:"+a + " b:"+b);
    }

}
